<?php

use yii\db\Migration;

/**
 * Class m190123_022226_create_type_tables
 */
class m190123_022226_create_type_tables extends Migration
{
    /**
     * {@inheritdoc}
     */
    public function safeUp()
    {
        $this->createTable('job_type',[
            'id'=>$this->primaryKey(),
            'name'=>$this->string()->notNull()->comment("种类名称"),
            'type'=>$this->tinyInteger()->notNull()->comment("类型"),
        ]);

    }

    /**
     * {@inheritdoc}
     */
    public function safeDown()
    {
//        echo "m190123_022226_create_type_tables cannot be reverted.\n";
        $this->dropTable('job_type');
        return false;
    }

    /*
    // Use up()/down() to run migration code without a transaction.
    public function up()
    {

    }

    public function down()
    {
        echo "m190123_022226_create_type_tables cannot be reverted.\n";

        return false;
    }
    */
}
